/**
 * @Date 2025/1/4 20:43
 * @Created by 衡盛永
 */

package org.example.deploy.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/security")
public class SecurityController {

    @RequestMapping("test")
    @PreAuthorize("hasRole('ROLE_admin')")
    public String test() {
        return "test security";
    }

    @RequestMapping("read")
    public String read() {
        return "test read";
    }
}
